<template>
  <z-upload-dragger
    v-model:fileList="fileList"
    name="file"
    :multiple="true"
    action=""
    @change="handleChange"
    @drop="handleDrop"
  >
    <p class="ant-upload-drag-icon">
      <inbox-outlined></inbox-outlined>
    </p>
    <p class="ant-upload-text">Click or drag file to this area to upload</p>
    <p class="ant-upload-hint">
      Support for a single or bulk upload. Strictly prohibit from uploading company data or other
      band files
    </p>
  </z-upload-dragger>
</template>
<script>
import { message } from '../../../../lib/index.js'
import { defineComponent, ref } from 'vue'
export default defineComponent({
  setup() {
    const handleChange = info => {
      const status = info.file.status

      if (status !== 'uploading') {
        console.log(info.file, info.fileList)
      }

      if (status === 'done') {
        message.success(`${info.file.name} file uploaded successfully.`)
      } else if (status === 'error') {
        message.error(`${info.file.name} file upload failed.`)
      }
    }

    return {
      handleChange,
      fileList: ref([]),
      handleDrop: e => {
        console.log(e)
      }
    }
  }
})
</script>
